home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
351-375
/
disk_359
/
dice
/
dice.lzh
/
lib
/
stdlib
/
system.c
< prev
Wrap
C/C++ Source or Header
|
1990-03-30
|
753b
|
45 lines
/*
* SYSTEM.C Dynamically check whether we are running under 1.3 or 1.4
*
* (c)Copyright 1990, Matthew Dillon, All Rights Reserved
*/
#include <exec/types.h>
#include <exec/libraries.h>
#ifdef INCLUDE_VERSION /* doesn't exist in 1.3 */
#include <dos/dostags.h>
#endif
extern struct Library *DOSBase;
system(buf)
const char *buf;
{
int r;
#ifdef INCLUDE_VERSION
if (DOSBase->lib_Version >= 36) {
static struct TagItem TI[] = {
SYS_Input , 0,
SYS_Output, 0,
TAG_DONE, 0
};
TI[0].ti_Data = Input();
TI[1].ti_Data = Output();
r = System(buf, TI);
} else {
#endif
r = Execute(buf, NULL, NULL);
if (r == 0)
r = -1;
else if (r == -1)
r = 0;
#ifdef INCLUDE_VERSION
}
#endif
return(r);
}